/**
 * Like.java	1.0 2007 六月 1 16:57:24,创建
 */

package org.in4j.search.query;

import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.WildcardQuery;

/**
 *
 * @author 杨帆
 * @version 1.0 2007 六月 1 16:57:24,创建
 */
public class Like implements IQuery
{
	private final String field;
	private final String text;

	public Like(String field,String text)
	{
		this.field = field;
		this.text = text;
	}

	public Query getQuery()
	{
		Query query = new WildcardQuery(new Term(field,"\"?" + text + "*\""));
		return query;
	}
}
